/**
 *
 * @description:目录视图控制器
 * @author:junyong.hong
 * @createTime:2017.11.07
 * @version:1.0.0.0
 * @history:
 *    1、
 *    2、
 *
 */
define([
    'angularAMD',
    'config'
  ], function (angularAMD, app) {
    app.provider('loginRouter', function ($stateProvider) {
        this.$get = function () {
            var service, CURRENT_PATH = 'components/module/';

            service = {
                'setRouter': function () {
                    $stateProvider
                        .state('index.login', angularAMD.route({//登录页
                            url: '/login',
                            templateUrl: CURRENT_PATH + 'login/login.html',
                            controllerAs:'loginVM',
                            controllerUrl: CURRENT_PATH + 'login/login.controller.js',
                            controller: 'login.controller'
                        }))
                        // .state('login', angularAMD.route({//登录页
                        //     url: '/login',
                        //     templateUrl: CURRENT_PATH + 'login/login.html',
                        //     controllerAs:'loginVM',
                        //     controllerUrl: CURRENT_PATH + 'login/login.controller.js',
                        //     controller: 'login.controller'
                        // }))
                        .state('index.home', angularAMD.route({//页面里放ui-view
                            url: '/home',
                            templateUrl: CURRENT_PATH + 'home/home.html',
                            controllerAs:'homeVM',
                            controllerUrl: CURRENT_PATH + 'home/home.controller.js',
                            controller: 'home.controller'
                        }))
                        .state('index.dashboard', angularAMD.route({//仪表盘
                            url: '/dashboard',
                            templateUrl: CURRENT_PATH + 'dashboard/dashboard.html',
                            controllerAs:'vm',
                            controllerUrl: CURRENT_PATH + 'dashboard/dashboard.controller.js',
                            controller: 'dashboard.controller'
                        }))
                }
            };
            return service;
        }
    }).run(function (loginRouter) {
        loginRouter.setRouter();
    });
  });
  